import RNFileSelector from 'react-native-file-selector';

export default class FileHelper {
    public static select():Promise<string>{
        return new Promise<string>(function (resolve, reject) {
            RNFileSelector.Show(
                {
                    title: '请选择文件',
                    onDone: (path) => {
                        // console.log('file selected: ' + path)
                        resolve(path);
                    },
                    onCancel: () => {
                        // console.log('cancelled')
                        reject();
                    }
                }
            )
        });
    }
}
